#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
#define debug(a) cout<<#a<<":"<<a<<endl;
#define fr freopen("in.txt","r",stdin);
#define for0(i,a,b) for (int i=a;(i<b);i++)
#define for1(i,a,b) for (int i=a;(i<=b);i++)
#define dec0(i,a,b) for (int i=a;(i>b);i--)
#define dec1(i,a,b) for (int i=a;(i>=b);i--)
#define Fill(x,a) memset(x,a,sizeof(x))
const int INF=0x3f3f3f3f;
const int N=1e6+7;
const int mod=1e9+7;
int maxn,minn;
int T,n,m,q;
char arr[5]={'a','e','i','o','u'};
string s;

int main(){
	cin>>T;
	while(T--){
		int ans=0;
		cin>>s;
		int len=s.size();
		for0(i,0,len){
			for0(j,0,5){
				if(s[i]==arr[j]){
					ans++;
					break;
				}
			}
		}
		cout<<s<<endl;
//		cout<<ans<<endl;
		if(ans*2>len){
			puts("1");
		}
		else{
			puts("0");
		}
	} 



	return 0;
}


